package com.nanyang.tms.domain.waybill.shipment.context;

import java.io.Serializable;

import com.nanyang.common.core.flow.context.AbsTransHandlerContext;
import com.nanyang.tms.domain.cost.context.CalculateCostFreightContext;
import com.nanyang.tms.domain.waybill.context.SaveTackInfoContext;
import com.nanyang.tms.domain.waybill.context.UpdateForecastContext;

import lombok.Data;
@Data
public class WaybillShipmentAddContext extends AbsTransHandlerContext implements Serializable{
	private static final long serialVersionUID = 1L;
	private CheckSupplierNoContext checkSupplierNoContext;
    private CalculateSupplierWeightContext calculateSupplierWeightContext;
    private CalculateCostFreightContext calculateCostFreightContext;
    private SaveWaybillShipmentContext saveWaybillShipmentContext;
	private UpdateForecastContext  updateForecastContext;
	private SaveTackInfoContext saveTackInfoContext; 
    public WaybillShipmentAddContext(){
    	this.checkSupplierNoContext=new CheckSupplierNoContext();
    	this.calculateCostFreightContext=new CalculateCostFreightContext();
    	this.calculateSupplierWeightContext=new CalculateSupplierWeightContext();
    	this.saveWaybillShipmentContext=new SaveWaybillShipmentContext();
		this.updateForecastContext=new UpdateForecastContext();
		this.saveTackInfoContext=new SaveTackInfoContext();
    }
    
	@Override
	public Object getTransHandlerContext(Class<?> cls) {
		if(cls.getSimpleName().equals("CheckSupplierNoContext")){
			return this.getCheckSupplierNoContext();
		}else if (cls.getSimpleName().equals("CalculateSupplierWeightContext")){
			return this.getCalculateSupplierWeightContext();
		}else if (cls.getSimpleName().equals("CalculateCostFreightContext")){
			return this.getCalculateCostFreightContext();
		}else if (cls.getSimpleName().equals("UpdateForecastContext")){
			return this.getUpdateForecastContext();
		}else if (cls.getSimpleName().equals("SaveTackInfoContext")){
			return this.getSaveTackInfoContext();
		}
		else if (cls.getSimpleName().equals("SaveWaybillShipmentContext")){
			return this.getSaveWaybillShipmentContext();
		}
		else{
			throw new RuntimeException("无此属性");
		}
	}

}
